<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            padding: 20px;
            display: flex;
            justify-content: space-between;
        }
    </style>
</head>
<body>
    <div>

        <div>

            
            <input
            type="file"
            id="upload"
            onchange="upload()"
            capture="camera"
           
              
          />
        </div>
        
  
        <div>
            <input type="file"   id="choseImg" accept="image/*"  οnchange="choseImg()">
  
        </div>


        <div class="box">
            <div  onclick="camera()">调用摄像头</div>
            <div onclick="xiangce()">调用相册</div>
        </div>

    </div>
    <script>

        function camera(){
            document.querySelector('#upload').click();
        }

        function xiangce(){
            document.querySelector('#choseImg').click();
        }

        function upload(){
            document.write('调用摄像头')
        }

        function choseImg(){
            document.write('调用相册')
    
        }


          

    </script>
</body>
</html>